package com.zjw.zy.bean;


import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;
import com.zjw.zy.constant.BindLoveState;

public class BindLoveInfo implements Parcelable {
    @SerializedName("id")
    private  Long id;
    @SerializedName("accept")
    private  Boolean accept;
    @SerializedName("state")
    @BindLoveState.Des
    private  Integer state;

    public BindLoveInfo() {
    }

    protected BindLoveInfo(Parcel in) {
        if (in.readByte() == 0) {
            id = null;
        } else {
            id = in.readLong();
        }
        byte tmpAccept = in.readByte();
        accept = tmpAccept == 0 ? null : tmpAccept == 1;
        if (in.readByte() == 0) {
            state = null;
        } else {
            state = in.readInt();
        }
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        if (id == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(id);
        }
        dest.writeByte((byte) (accept == null ? 0 : accept ? 1 : 2));
        if (state == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(state);
        }
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<BindLoveInfo> CREATOR = new Creator<BindLoveInfo>() {
        @Override
        public BindLoveInfo createFromParcel(Parcel in) {
            return new BindLoveInfo(in);
        }

        @Override
        public BindLoveInfo[] newArray(int size) {
            return new BindLoveInfo[size];
        }
    };


    public Long getId() {
        return id;
    }

    public Boolean getAccept() {
        return accept;
    }

    public Integer getState() {
        return state;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setAccept(Boolean accept) {
        this.accept = accept;
    }

    public void setState(Integer state) {
        this.state = state;
    }
}
